<?php
/**
 * Created by pangyiguang.
 * User: pangyiguang
 * Date: 2019/6/1
 * Time: 16:47
 */

//phpinfo();


echo '<pre>';

$manager = new MongoDB\Driver\Manager("mongodb://mongo:27017/");
$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY);
$server = $manager->selectServer($rp);
var_dump($server->getInfo());

$redis = new Redis();
$redis->connect('redis', 6379); //连接Redis
//$redis->auth('mypasswords123sdfeak'); //密码验证
$redis->select(2);//选择数据库2
$redis->set( "testKey" , "Hello Redis"); //设置测试key
echo $redis->get("testKey");//输出value

